@extends('backend.layouts.main')
@section('content')
    <section class="content-header">
        <h1>
            课程列表
            <small>课程列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{URL('admin/index')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active"><a href="{{URL('admin/dances')}}">课程列表</a></li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                {!!view("backend.dances._search",['request'=>$request])->render()!!}
                <!-- /.box-header -->
                    <div class="box-body  table-responsive ">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th style="width: 10px">#</th>
                                <th>课程名称</th>
                                <th>授课老师</th>
                                <th>上课时间</th>
                                <th>截止时间</th>
                                <th>课程费用</th>
                                <th>vip价格</th>
                                <th>上课地点</th>
                                <th>课程图片</th>
                                <th>课程类型</th>
                                <th>团课已约人数</th>
                                <th>课程状态</th>
                                <th>备注</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            @if(!empty($dancesList[0]->id))
                                @foreach($dancesList AS $key=>$danceData)
                                    <tr style="color:#888;font-weight:normal">
                                        <td>{{$danceData->id}}</td>
                                        <td>{{$danceData->name}}</td>
                                        <td>{{$danceData->user_name}}</td>
                                        <td>{{date('Y-m-d H:i:s',$danceData->begin_time)}}</td>
                                        <td>{{date('Y-m-d H:i:s',$danceData->end_time)}}</td>
                                        <td>{{$danceData->course_price}}</td>
                                        <td>{{$danceData->vip_price}}</td>
                                        <td>{{$danceData->address}}</td>
                                        <td>
                                            <img src="{{$danceData->images}}" width="50px">
                                        </td>
                                        <td>
                                            @if($danceData->types==0)
                                                <span class="label label-success">团课</span>
                                            @else
                                                <span class="label label-success">私教</span>
                                            @endif
                                        </td>
                                        <td>{{$danceData->league_subscribe_number?$danceData->league_subscribe_number:""}}</td>
                                        <td>
                                            @if($danceData->types==0)
                                                @if($danceData->dance_status==0)
                                                    <span class="label label-danger">未约满</span>
                                                @else
                                                    <span class="label label-success">已约满</span>
                                                @endif
                                            @else
                                                @if($danceData->dance_status==0)
                                                    <span class="label label-danger">未预约</span>
                                                @else
                                                    <span class="label label-success">已预约</span>
                                                @endif
                                            @endif
                                        </td>
                                        <td>{{$danceData->remark}}</td>
                                        <td>{{$danceData->created_at}}</td>
                                        <td>
                                            <a type="button" href="dances/{{encryptionUrl($danceData->id)}}/edit"
                                               class="btn btn-info btn-sm"><i class="fa fa-edit "></i> 修改</a>
                                        <!--<a type="button" onclick="delConfirm('dances/{{$danceData->id}}', 'dances')" class="btn btn-danger btn-sm"><i class="fa fa-close"></i>删除</a>-->
                                        </td>
                                    </tr>
                                @endforeach
                            @else
                                <tr style="color:#888;font-weight:normal">
                                    <td colspan="16" align="center">暂无数据</td>
                                </tr>
                            @endif
                        </table>
                    </div>
                    {!!view("backend.common._page",['datas'=>$dancesList,'request'=>$request])->render()!!}
                </div>
            </div>
        </div>
    </section>
    {!!view("backend.common.status")->render()!!}
@endsection
